package cn.genmer.test.security.rpc.v2.rpc.transport;

import cn.genmer.test.security.rpc.v2.rpc.ResponseMappingCallback;
import cn.genmer.test.security.rpc.v2.rpc.protocol.GPackmsg;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelInboundHandlerAdapter;

class GClientResponse extends ChannelInboundHandlerAdapter {
    @Override
    public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception {
        GPackmsg responsePkg = (GPackmsg) msg;

        // 曾经没考虑返回的事情
        //TODO RequestID 处理对应流程
        ResponseMappingCallback.runCallBack(responsePkg.getHeader().getRequestId(), responsePkg);
        super.channelRead(ctx, msg);
    }
}
